package com.example.news.service;

import com.example.news.bean.News;
import com.example.news.bean.Type;
import com.example.news.bean.User;
import com.example.news.mapper.TypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class TypeService {
    @Autowired
    TypeMapper typeMapper;

    /**
     * 查询所有类型
     * @return
     */
    public Map<String, Object> selectType() {
        Map<String,Object>  resp = new HashMap<>();
        List<Type> types= typeMapper.selectType();
        resp.put("code",200);
        resp.put("msg","查询成功");
        resp.put("data",types);
        return resp;
    }
}
